package util.groovy.captcha
/**
 * Created by IntelliJ IDEA.
 * User: Simon
 * Date: 1.9.2009
 * Time: 0:59:10
 * To change this template use File | Settings | File Templates.
 */

public class Captcha {
  int numA
  int numB
  char operator
  static final max = 10
  int result
  boolean correctAnswer

  public Captcha(){
    Random rnd = new Random()
    numA = rnd.nextInt(max+1)
    numB = rnd.nextInt(max+1)
    operator = '+'
    result = numA + numB
    correctAnswer = false
  }

  public String toString(){
    return "${numA} ${operator} ${numB}"
  }
}